Group Reading Modes
QuickDraw 3D provides routines that let you control how group objects are read.
Q3File_SetReadInGroup
You can use the Q3File_SetReadInGroup function to set the mode by which objects in a group are read.
TQ3Status Q3File_SetReadInGroup(
TQ3FileObject file,
TQ3FileReadGroupState readGroupState);
-
file
-
A metafile object.
-
readGroupState
-
The mode of reading objects in a group; see
"Group Reading States"
.
DESCRIPTION
The Q3File_SetReadInGroup function sets the group reading mode for the metafile object
file
to one of the two following values, based on the value of readGroupState. The default value for readGroupState is
kQ3FileReadWholeGroup
.
-
kQ3FileReadWholeGroup
-
A group is read as a single object; a single call to
Q3File_ReadObject
reads the group and everything in it.
-
kQ3FileReadObjectsInGroup
-
Each object inside the group is read individually. In this case, the first call to
Q3File_ReadObject
reads the group itself and returns an empty group. Each subsequent
Q3File_ReadObject
call reads one more object. The last
Q3File_ReadObject
call returns an
EndGroup
object; this signals that the end of the group has been read.
-
So long as the
TQ3FileReadGroupState
has most recently been set to
kQ3FileReadObjectsInGroup
, every group that's encountered will be read this way.
-
You can set
kQ3FileReadObjectsInGroup
, read some groups, then set the state back to
kQ3FileReadWholeGroup
. When this has been done, then every new group will be read in as with
kQ3FileReadWholeGroup
, but groups currently being read will finish as with
kQ3FileReadObjectsInGroup
. Because groups can be nested, it is possible to be inside of many groups, all of which would be completed as with
kQ3FileReadObjectsInGroup
.
Q3File_GetReadInGroup
You can use the Q3File_GetReadInGroup function to set the mode by which objects in a group are read.
TQ3Status Q3File_GetReadInGroup(
TQ3FileObject file,
TQ3FileReadGroupState *readGroupState);
-
file
-
A metafile object.
-
readGroupState
-
A mask for the mode of reading objects in a group; see
"Group Reading States"
.
DESCRIPTION
The Q3File_SetReadInGroup function gets a mask for the group reading mode of the metafile object
file
and returns it in readGroupState. In addition to either of the values described in
"Q3File_SetReadInGroup"
(
kQ3FileReadWholeGroup
or
kQ3FileReadObjectsInGroup
), readGroupState can have this value:
-
kQ3FileCurrentlyInsideGroup
-
This value is OR-combined into the mask if the reading process is currently inside a group. This value is compatible with the next group being read with either
kQ3FileReadWholeGroup
or
kQ3FileReadObjectsInGroup
.
© 1997 Apple Computer, Inc.
Previous | QD3D Book | Overview | Chapter Contents | Next |